//
//  ESTSmallTitleView.m
//  ESTSCRMAPP
//
//  Created by 李贤立 on 2018/11/2.
//  Copyright © 2018年 Capfer. All rights reserved.
//

#import "ESTSmallTitleView.h"

@interface ESTSmallTitleView ()
/**
 *  线
 */
@property(nonatomic, strong) TYZView *line;
/**
 *  文本
 */
@property(nonatomic, strong) TYZLabel *label;
@end

@implementation ESTSmallTitleView

- (instancetype)init {
    if (self = [super init]) {
        TYZView *line = [[TYZView alloc] init];
        [self addSubview:line];
        [line mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self);
            make.width.mas_equalTo(4);
            make.height.mas_equalTo(15);
            make.centerY.equalTo(self);
        }];
        line.backgroundColor = ThemeColor;
        self.line = line;
        
        TYZLabel *label = [[TYZLabel alloc] init];
        [self addSubview:label];
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(line.mas_right).offset(10);
        }];
        label.font = [UIFont boldSystemFontOfSize:CoreInfo.fontSize];
        label.textColor = TYZBlackColor;
        self.label = label;
    }
    return self;
}
- (void)setTitle:(NSString *)title {
    _title = title;
    self.label.text = title;
}
- (void)setLineColor:(UIColor *)lineColor {
    _lineColor = lineColor;
    self.line.backgroundColor = lineColor;
    self.label.textColor = lineColor;
}
@end
